home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 4 / Mac Giga-ROM 4.0 - 1993.toast / FILES / HYP / R-S / Sound Scripter / card_4137.txt < prev    next >
Encoding:
Text File  |  1989-02-26  |  9.4 KB  |  287 lines

  1. -- card: 4137 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 6070
  5. -- name: editMenuCard
  6. ----- HyperTalk script -----
  7. on openCard
  8.   set the lockText of card field "voiceListField" to false
  9.   set the scroll of card field "voiceListField" to 0
  10.   set rect of card field "voiceListField" to 297,29,504,337
  11.   set the lockText of card field "defaultVoiceListField" to true
  12.   set the rect of card field "defaultVoiceListField" to 297,29,504,337
  13.   set the visible of card field "defaultVoiceListField" to false
  14.   set the scroll of card field "menuHelpField" to 0
  15.   set the lockText of card field "menuHelpField" to true
  16.   set the rect of card field "menuHelpField" to 6,77,290,337
  17. end openCard
  18.  
  19. on closeCard
  20.   global rebuildPopUpMenu,voice
  21.   put true into rebuildPopUpMenu
  22.   testForEmptyVoiceList
  23.   deleteEmptyLines "VoiceListField"
  24.   put false into validVoice
  25.   repeat with i = 1 to number of lines in card field "voiceListField"
  26.     if line i of card field "voiceListField" = voice then
  27.       put true into validVoice
  28.       exit repeat
  29.     end if
  30.   end repeat
  31.   if validVoice = false then
  32.     put line 1 of card field "voiceListField" into voice
  33.     if voice = "Silence" then
  34.       put line 2 of card field "voiceListField" into voice
  35.     end if
  36.   end if
  37.   put voice into line 4 of card field "storedValues" of card "piano keyboard"
  38. end closeCard
  39.  
  40. on testForEmptyVoiceList
  41.   if card field "voiceListField" is empty then
  42.     set the cursor to 4
  43.     beep
  44.     answer "Hey! The ‚Äòsnd ‚Äô resource names list is empty." with "Put it back"
  45.     send mouseUp to card button "Restore Default List"
  46.   end if
  47. end testForEmptyVoiceList
  48.  
  49. on deleteEmptyLines theField
  50.   put false into refresh
  51.   put empty into temp
  52.   put the number of lines of card field theField into lineCount
  53.   repeat with i = 1 to lineCount
  54.     get line i of card field theField
  55.     put it into theVoiceName
  56.     if the number of chars of theVoiceName <= 1 then
  57.       put true into refresh
  58.       next repeat
  59.     end if
  60.     put theVoiceName&return after temp
  61.   end repeat
  62.   if refresh is true then
  63.     put temp into card field theField
  64.   end if
  65. end deleteEmptyLines
  66.  
  67. on doMenu which
  68.   if which is "Cut Text" or which is "Clear Text" then
  69.     send "doMenu Cut Text" to HyperCard
  70.     exit doMenu
  71.   end if
  72.   if which is "Paste Text" then
  73.     send "doMenu Paste Text" to HyperCard
  74.     exit doMenu
  75.   end if
  76.   pass "doMenu"
  77. end doMenu
  78.  
  79.  
  80.  
  81. -- part 15 (field)
  82. -- low flags: 81
  83. -- high flags: 2007
  84. -- rect: left=297 top=29 right=337 bottom=504
  85. -- title width / last selected line: 0
  86. -- icon id / first selected line: 0 / 0
  87. -- text alignment: 0
  88. -- font id: 3
  89. -- text size: 12
  90. -- style flags: 0
  91. -- line height: 16
  92. -- part name: defaultVoiceListField
  93.  
  94.  
  95. -- part 22 (button)
  96. -- low flags: 00
  97. -- high flags: A000
  98. -- rect: left=55 top=23 right=72 bottom=98
  99. -- title width / last selected line: 0
  100. -- icon id / first selected line: 20882 / 20882
  101. -- text alignment: 1
  102. -- font id: 0
  103. -- text size: 12
  104. -- style flags: 0
  105. -- line height: 16
  106. -- part name: Help
  107. ----- HyperTalk script -----
  108. on mouseUp
  109.   visual effect iris open
  110.   go to card "helpCard"
  111. end mouseUp
  112.  
  113.  
  114.  
  115.  
  116. -- part 23 (field)
  117. -- low flags: 01
  118. -- high flags: 0000
  119. -- rect: left=347 top=90 right=114 bottom=385
  120. -- title width / last selected line: 0
  121. -- icon id / first selected line: 0 / 0
  122. -- text alignment: 0
  123. -- font id: 3
  124. -- text size: 12
  125. -- style flags: 0
  126. -- line height: 16
  127. -- part name: theScrollAmtField
  128. ----- HyperTalk script -----
  129. voiceListAmtField
  130.  
  131.  
  132. -- part 9 (field)
  133. -- low flags: 01
  134. -- high flags: 2007
  135. -- rect: left=6 top=77 right=337 bottom=290
  136. -- title width / last selected line: 0
  137. -- icon id / first selected line: 0 / 0
  138. -- text alignment: 0
  139. -- font id: 3
  140. -- text size: 12
  141. -- style flags: 0
  142. -- line height: 16
  143. -- part name: menuHelpField
  144.  
  145.  
  146. -- part 10 (button)
  147. -- low flags: 00
  148. -- high flags: A000
  149. -- rect: left=6 top=24 right=71 bottom=54
  150. -- title width / last selected line: 0
  151. -- icon id / first selected line: 30238 / 30238
  152. -- text alignment: 1
  153. -- font id: 0
  154. -- text size: 12
  155. -- style flags: 0
  156. -- line height: 16
  157. -- part name: Keyboard
  158. ----- HyperTalk script -----
  159. on mouseUp
  160.   visual effect dissolve
  161.   go to card "piano keyboard"
  162. end mouseUp
  163.  
  164.  
  165.  
  166. -- part 16 (button)
  167. -- low flags: 00
  168. -- high flags: A004
  169. -- rect: left=134 top=29 right=62 bottom=291
  170. -- title width / last selected line: 0
  171. -- icon id / first selected line: 0 / 0
  172. -- text alignment: 1
  173. -- font id: 0
  174. -- text size: 12
  175. -- style flags: 0
  176. -- line height: 16
  177. -- part name: Restore Default List
  178. ----- HyperTalk script -----
  179. -- voiceListField:       the list of available ‚Äòsnd ‚Äô resources
  180. -- defaultVoiceListField:the default list of available ‚Äòsnd ‚Äô resources
  181.  
  182. on mouseUp
  183.   global theSelection
  184.   put empty into theSelection
  185.   put "voiceListField" into toField
  186.   put "defaultVoiceListField" into fromField
  187.   put the number of lines of card field fromField into lineCount
  188.   put empty into card field toField
  189.   repeat with i = 1 to lineCount
  190.     put line i of card field fromField&return after card field toField
  191.     play line i of card field toField
  192.   end repeat
  193.   set the scroll of card field toField to 0
  194. end mouseUp
  195.  
  196.  
  197.  
  198. -- part 1 (field)
  199. -- low flags: 00
  200. -- high flags: 2007
  201. -- rect: left=297 top=29 right=337 bottom=504
  202. -- title width / last selected line: 0
  203. -- icon id / first selected line: 0 / 0
  204. -- text alignment: 0
  205. -- font id: 0
  206. -- text size: 12
  207. -- style flags: 0
  208. -- line height: 16
  209. -- part name: voiceListField
  210.  
  211.  
  212. -- part 20 (field)
  213. -- low flags: 81
  214. -- high flags: 2004
  215. -- rect: left=5 top=24 right=128 bottom=340
  216. -- title width / last selected line: 0
  217. -- icon id / first selected line: 0 / 0
  218. -- text alignment: 0
  219. -- font id: 0
  220. -- text size: 12
  221. -- style flags: 0
  222. -- line height: 16
  223. -- part name: deleteSNDHelpField
  224. ----- HyperTalk script -----
  225. on mouseUp
  226.   set the visible of me to false
  227.   set the visible of card button "OK" to false
  228. end mouseUp
  229.  
  230.  
  231. -- part 21 (button)
  232. -- low flags: 80
  233. -- high flags: A003
  234. -- rect: left=123 top=87 right=115 bottom=196
  235. -- title width / last selected line: 0
  236. -- icon id / first selected line: 0 / 0
  237. -- text alignment: 1
  238. -- font id: 0
  239. -- text size: 12
  240. -- style flags: 0
  241. -- line height: 16
  242. -- part name: OK
  243. ----- HyperTalk script -----
  244. on mouseUp
  245.   set the visible of card field "deleteSNDHelpField" to false
  246.   set the visible of me to false
  247. end mouseUp
  248.  
  249.  
  250.  
  251. -- part contents for card part 9
  252. ----- text -----
  253.  ‚ÄîCustomizing the pop-up Voice menu‚Äî
  254.  
  255.     Add the names of any installed 'snd ' resources that you wish to use. When you return to the main card, the new voices will appear in the menu inside the Voice button. Misspelled names will be treated by HyperCard as the Silence voice. Attempting to delete the entire list will restore the default set.
  256.     This version of Sound Scripter is stripped down with no 'snd 'resources of its own for to save space. My working copy, with 31 voices weighs in at 516K.
  257.     Only 32 items will fit in the pop-up menu, and I have reserved the first item to send you to this card, so any voice installed after the 31st one in the list at the right will not appear in the menu. Rearrange the names so that the voices you will be needing on the current script will be within the first 31 listed. 
  258.     The Silence voice is not required as rests can be included in the script without it ( by holding down the Option key while clicking on a note button on the keyboard ). See the Help cards for more information.
  259.     Names in the "voiceListField" at the right are not always what they appear to be. A name so long that it wraps around to the next line will  appear in the actual pop-up Voice menu as one line (assuming that it is no wider than the screen), and double-clicking on it in the "voiceListField" should select the entire name. If you experience trouble with very long names, try stretching the "voiceListField" to the full width of the screen.
  260.     Don‚Äôt worry about empty lines in the list, they‚Äôll be removed before the actual Voice menu is reconstructed.
  261.     If you want your customized Voice list to become the default Voice list, you can find the default list field 
  262. (named  "defaultVoiceListField") under the editable list at the right.  To work on it, move the "voiceListField" aside and type { set the visible of card field    "defaultVoiceListField" to true } without the brackets into the message box and hit the return key. Turn off the   "Lock Text" button and rearrange to your heart‚Äôs content, at your own risk, of course. The next time this card receives the "openCard" message the fields will return to their correct location with the default list‚Äôs text properly locked.
  263.     My script checks to see that you haven‚Äôt deleted the entire list when you go to another card, so regardless of the editing method you use, you should at least find something in the pop-up Voice menu when you next use it.
  264.     I use ResEdit to install 'snd ' resources, but ResEdit can wreck havoc in inexperienced hands, so only attempt this if you know what you‚Äôre doing or don‚Äôt much care if you trash your software in the process. There are a number of stacks and utilities available to move 'snd ' resources painlessly. I had hoped to automate the installing of resources with a Font/DA style of interface, but I need an 'XCMD' to poll the resources first.
  265.  
  266. -- part contents for card part 15
  267. ----- text -----
  268. Silence
  269. Boing
  270. Harpsichord
  271.  
  272.  
  273. -- part contents for card part 20
  274. ----- text -----
  275.      Click on a voice from the ‚ÄúAvailable Voices‚Äù     scrolling field to select it, then click on the         ‚Äúdelete Voice‚Äù button to remove it.
  276.      
  277.  
  278. -- part contents for card part 23
  279. ----- text -----
  280. 257
  281.  
  282. -- part contents for card part 1
  283. ----- text -----
  284. Silence
  285. Boing
  286. Harpsichord
  287.